package cn.lkp.controller;

import cn.lkp.bean.Tag;
import cn.lkp.bean.TagExample;
import cn.lkp.bean.TagRelation;
import cn.lkp.dao.TagMapper;
import cn.lkp.dao.TagRelationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class forrignTest {

    @Autowired
    TagMapper tagMapper;
    @Autowired
    Tag tag;

    @Autowired
    TagRelation tagRelation;

    @Autowired
    TagRelationMapper tagRelationMapper;

    @RequestMapping("/foreign")
    @ResponseBody
    public String foreign(){
//        long l = tagMapper.countByExample(new TagExample());
//        tag.setTagId((int) (l+1));
//        tag.setTagDescription("123");
//        tag.setTagType(1);
//        tag.setTagUuid("456");
//        int insert = tagMapper.insert(tag);

        tagRelation.setResRessetId(123);
        tagRelation.setResType(555);
        tagRelation.setTagId(99);
        //这里需要写
        int insert = tagRelationMapper.insert(tagRelation);
        return String.valueOf(insert);

    }
}
